package se.webbzon.boltzmann.minigame.page;


public class ImageTag implements Tag {

	@Override public String getName() {
		return "img";
	}

	@Override public PageItem createItem(PageLayout layout, String content) {
		PageImage img;
		int pos = content.indexOf(":");
		if (pos == -1) {
			img = new PageImage(layout, content);
		} else {
			img = new PageImage(layout, content.substring(0, pos));
			img.setCaption(content.substring(pos+1));
		}
		return img;
	}

}
